<?
include('./header.inc');
include('./database.inc');

if (!isset($_GET['uid'])){
	header( 'Location: ./users.php' ) ;
	die();
}

$uid = mysql_real_escape_string($_GET['uid']);

if ($_GET['uid'] == $_SESSION['uid']){
	notify("error", "Can't Delete Self");
	header( 'Location: ./users.php' ) ;
	die();
}

$query = "DELETE FROM users WHERE user_id='$uid'";

$result = mysql_query($query);

notify("success", "User Deleted");
header( 'Location: ./users.php' ) ;

?>